home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Graphics Programming (2nd Edition) / Visual Basic Graphics Programming 2nd Edition.iso / OldSrc / CH9 / SRC / DSINES.CLS < prev    next >
Encoding:
Text File  |  1995-11-15  |  659 b   |  28 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4. END
  5. Attribute VB_Name = "DistortSines"
  6. Attribute VB_Creatable = False
  7. Attribute VB_Exposed = False
  8. Option Explicit
  9.  
  10. ' The center about which to twist.
  11. Public amplitude As Single
  12. Public period As Single
  13.  
  14. ' ************************************************
  15. ' Apply a shape distorting transformation to
  16. ' the point.
  17. ' ************************************************
  18. Sub Distort(x As Single, y As Single, z As Single)
  19. Dim A As Single
  20. Dim sy As Single
  21. Dim sz As Single
  22.  
  23.     A = amplitude / 2
  24.     sy = Sin(y * 6.28 / period)
  25.     sz = Sin(z * 6.28 / period)
  26.     x = x + A * (sy + sz)
  27. End Sub
  28.